
import 'package:flutter/material.dart';
import 'package:flutter_ahj_app/base/values/dimens.dart';




class DropdownInputView extends StatefulWidget {

  final String labelText;
  final String errorText;
  final TextEditingController textEditingController;///获取值
  final FocusNode focusNode;///焦点
  final ValueChanged onChanged;///
  final List items;
  final value;
  ///
  DropdownInputView({
    Key key,
    this.labelText,
    this.value,
    this.textEditingController,
    this.errorText,
    this.focusNode,
    this.onChanged,
    @required this.items,
  }) : super(key: key);

  @override
  _DropdownInputViewState createState() => _DropdownInputViewState();

}
class _DropdownInputViewState extends State<DropdownInputView> {
  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: const EdgeInsets.fromLTRB(15, 15, 15, 0),
      child: DropdownButtonFormField(
        items: widget.items,
        value: widget.value,//下拉菜单选择完之后显示给用户的值
        onChanged: widget.onChanged,

        decoration: InputDecoration(
          contentPadding: EdgeInsets.all(Dimens.dimens16),
          labelText: widget.labelText,
          border: OutlineInputBorder(),
        ),
      ),
    );

  }
}
